package NWPackage;

//import NW_Dynamic.Dynamic;



public class NW_Main {

	 /*meaninig of the args:
	  *  0: sushi-skewness netflix-file
	  *  1:sushi: exp netflix-folder
	  *  2: # of exps
	  *  3: exp type
	  *  4: mc iterations
	  *  5: % random q
	  *  6: use IG y/n
	  * 
	  * */
	
	public static void main(String[] args) throws Exception { 			
	//	init_sushi();	
	//	System.out.println("netflix");
	//	init_netflix();
		RunExperiment expp = new RunExperiment();
		expp.run_all_exps("experimentsFile.xls");
	}
	
	public static void init_netflix()throws Exception { 
		String[] myArgs;
		myArgs = new String[9];	  				
		myArgs[2] = "1";
		myArgs[4] = "300";		
		myArgs[6] = "y"; //use IG? 	
		
		//myArgs[1] = "netflix_jan/7_5";
		//myArgs[0] = "log_a.xls";
		//System.out.println(myArgs[1] + "/" + myArgs[0]);
		//exp_pack(myArgs,"netflix");
		
		myArgs[1] = "netflix_jan/12_5";
		myArgs[0] = "log_a.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
	/*	myArgs[1] = "netflix_jan/5_5";
		
		myArgs[0] = "log_a.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		*/
		myArgs[0] = "log_b.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_c.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
	/*	
		myArgs[0] = "log_d.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_e.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_f.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_g.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_h.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_i.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[1] = "netflix_jan/10_5";
		
		myArgs[0] = "log_a.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_b.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_c.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_d.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_e.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_f.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_g.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_h.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_i.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[1] = "netflix_jan/15_5";
		
		myArgs[0] = "log_a.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_b.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_c.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_d.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_e.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_f.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
   /*     myArgs[1] = "netflix_jan/20_5";
		
		myArgs[0] = "log_a.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_b.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_c.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_d.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
       myArgs[1] = "netflix_jan/25_5";
		
		myArgs[0] = "log_a.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
        myArgs[1] = "netflix_jan/30_5";
		
		myArgs[0] = "log_a.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
myArgs[1] = "netflix_jan/20_5";
				 			
		
		myArgs[0] = "log_c.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		
		myArgs[0] = "log_d.xls";
		System.out.println(myArgs[1] + "/" + myArgs[0]);
		exp_pack(myArgs,"netflix");
		*/
		
	}
		
	
	public static void init_sushi()throws Exception { 
		String[] myArgs;							
		myArgs = new String[9];	     
					 	     
		 //skewness file
		myArgs[0] = "sushi_skewTEST.xls";
		
		//num of exps
		myArgs[2] = "20";
		
		//MC iterations
		myArgs[4] = "300";
		//% random queries 
		myArgs[5]= "0";
		//use IG?
		myArgs[6] = "y"; 	

		myArgs[1] = "sushiTEST.xls";
	//	
		exp_pack(myArgs,"sushi");
		
	//	myArgs[1] = "sushi5000_10_ver2.xls";
		//sushi skew is skipped so not matter what the input is
	//	exp_pack(myArgs,"sushi");
	/*						
		myArgs[1] = "sushi12_6.xls";
		exp_pack(myArgs,"sushi");
		
			//exp file
		//myArgs[1] = "sushi5_6.xls";
	//	exp_pack(myArgs,"sushi");
			
	/*		//now go for other files...
		
		myArgs[1] = "sushi10_5.xls";
		exp_pack(myArgs,"sushi");
		
/*		myArgs[1] = "sushi15_5.xls";
		exp_pack(myArgs,"sushi");
		
		myArgs[1] = "sushi20_5.xls";
		exp_pack(myArgs,"sushi");
		
		myArgs[1] = "sushi25_5.xls";
		exp_pack(myArgs,"sushi");
		
		myArgs[1] = "sushi30_5.xls";
		exp_pack(myArgs,"sushi"); 
	*/	
		//--------------------------
	/*	System.out.println("sushi special");
		myArgs[0] = "sushi_skew6_special.xls";
		myArgs[1] = "sushi10_6_special.xls";
		exp_pack(myArgs,"sushi");
		System.out.println("--------------------------------------------------------------");
		System.out.println("--------------------------------------------------------------");
		 
		System.out.println("sushi fixed");
		myArgs[0] = "sushi_skew6_fixed.xls";
		myArgs[1] = "sushi10_6.xls";
		exp_pack(myArgs,"sushi");
		
	/*	
		myArgs[1] = "sushi15_6.xls";
		exp_pack(myArgs,"sushi");
		
		myArgs[1] = "sushi20_6.xls";
		exp_pack(myArgs,"sushi");
/*		
		myArgs[1] = "sushi25_6.xls";
		exp_pack(myArgs,"sushi");
		
		myArgs[1] = "sushi30_6.xls";
		exp_pack(myArgs,"sushi"); 
	*/	
	}
	
	 
	
	public static void exp_pack(String[] myArgs, String exptype) throws Exception{
		
		

	/*
		//em_borda (meir's suggested method from mail - based on current winner
	    System.out.println("10: EM_Borda");
		RunExperiment exp10 = new RunExperiment();	
		myArgs[3] = "10";
		exp10.run_exp(myArgs, exptype);	
		System.out.println("--------------------------------------------------------------");
		
	/*	 System.out.println("11: EM_Borda_Second_Winner");
			RunExperiment exp11 = new RunExperiment();	
			myArgs[3] = "11";
			exp11.run_exp(myArgs, exptype);	
			System.out.println("--------------------------------------------------------------");
		
		*/
	/*			
   	//pure Winner heuristic (emax/myopic - all is same)
		System.out.println("8:pure winner");
		RunExperiment exp1 = new RunExperiment();	
		myArgs[3] = "8";
		exp1.run_exp(myArgs, exptype);									
		System.out.println("--------------------------------------------------------------");
	
		//Random heuristic
		System.out.println("5:random");
		RunExperiment exp3 = new RunExperiment();				
		myArgs[3] = "5";
		exp3.run_exp(myArgs,exptype);			
/*		
		System.out.println("--------------------------------------------------------------");
		//Entropy only heuristic
		System.out.println("4:entropy");
		RunExperiment exp4 = new RunExperiment();				
		myArgs[3] = "4";
		exp4.run_exp(myArgs,exptype);		
		
		//entropy-winner
		System.out.println("1:entropy-winner");
		RunExperiment exp5 = new RunExperiment();				
		myArgs[3] = "1";
		exp5.run_exp(myArgs,exptype);
		
	/*	//pure preferred Winner heuristic
		System.out.println("9:pure-preferred winner");
		RunExperiment exp2 = new RunExperiment();	
		myArgs[3] = "9";
		exp2.run_exp(myArgs,exptype);
				
		//myopic
		System.out.println("6:myopic");
		RunExperiment exp6 = new RunExperiment();	
		myArgs[3] = "6";
		exp6.run_exp(myArgs,exptype);		
			
		
		//myopic-winner
		System.out.println("7:myopic-winner");
		RunExperiment exp7 = new RunExperiment();	
		myArgs[3] = "7";
		exp7.run_exp(myArgs,exptype);		 		 	
/*		//winner/looser
		RunExperiment exp3 = new RunExperiment();		
		myArgs[3] = "2";
		exp3.run_exp(myArgs,exptype);	
		
		//winner/2nd winner
		RunExperiment exp4 = new RunExperiment();		
		myArgs[3] = "3";
		//myArgs[6] = "n";		
		exp4.run_exp(myArgs,exptype);	
	*/				
		
	}
	
	 
}
